﻿using Hardware.Reactor.Base.Setting;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UI.Application.Reactor.Models;
using UI.Application.Share.Reactor;

namespace UI.Application.Reactor.ViewModels
{
    internal class ReactorViewModel : ReactiveObject
    {
        /// <summary>
        /// 当前选中的反应釜
        /// </summary>
        [Reactive]
        public IReactorModel Reactor { get; private set; }
        public IReactorManager ReactorManager { get; }
        public IReactorConfigProvider ReactorConfigProvider { get; }

        public ReactorViewModel(IReactorManager reactorManager, IReactorConfigProvider reactorConfigProvider)
        {
            ReactorManager = reactorManager;
            ReactorConfigProvider = reactorConfigProvider;
            reactorManager.Observable.Subscribe(p =>
            {
                this.Reactor = p;
            });
        }
    }
}
